<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>人和人律师事务所管理系统v1.0-实习律师信息查询</title>

<style type="text/css" media="all">
    .allow-float {clear:none!important;} /* 允许该元素浮动 */
    .stop-float {clear:both!important;} /* 阻止该元素浮动 */
	.float-left {float:left;padding-left:40px}   /*浮动到左边*/
  </style>

<!-- 引入外部删除律师助理处理的JS文件 -->
<script type="text/javascript" src="userSearchJs/delete_practice_lawyer_info.js"></script>
<!-- 引入外部修改律师助理处理的JS文件 -->
<script type="text/javascript" src="userSearchJs/modify_practice_lawyer_info.js"></script>
<script type="text/javascript">

Ext.onReady(function(){
	//设定超时时间
    Ext.Ajax.timeout=120000;

	Ext.BLANK_IMAGE_URL = '/ext/resources/images/default/s.gif';
    Ext.QuickTips.init();
    Ext.form.Field.prototype.msgTarget = 'side';
    //查询框
    var searchPracWindow = new Ext.form.FormPanel({
			title:'实习律师信息查询',
			labelAlign:'right',
			labelSeparator :'：',//分隔符
			labelWidth : 100,//标签宽度
			bodyStyle:'padding:5',//表单边距
			frame : true,
			collapsible: true,
			height:100,
			width:window.screen.width-220,
			applyTo :'searchPracWin',

			items:[
				new Ext.form.TextField({
					fieldLabel:'律师助理姓名',
					id : 'pracLawName',
					name : 'pracLawName',
					width:(window.screen.width-320)*0.18,
					itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
					selectOnFocus : true,//得到焦点时自动选择文本
					allowBlank : true
				}),

				new Ext.form.TextField({
					fieldLabel: '指导老师',
					id : 'pracGuideTeacher',
					name : 'pracGuideTeacher',
					width:(window.screen.width-320)*0.18,
					itemCls:'float-left',//向左浮动
					clearCls:'allow-float',//允许浮动
					selectOnFocus : true,//得到焦点时自动选择文本
					allowBlank : true
				}),

				new Ext.Button({
					text : '开始查询',
					iconCls:'search',
					cls:'float-left',//向左浮动
					handler : submitMsg
				})
			]

		})


	//查询处理函数
	function submitMsg(){
		var pracLawName=Ext.getCmp("pracLawName").getValue();
		var pracGuideTeacher=Ext.getCmp("pracGuideTeacher").getValue();

		//判断用户是否输入了信息
		if(pracLawName==""&&pracGuideTeacher==""){
		Ext.Msg.alert('提示','请输入查询条件');
		return;
		}
		 store = new Ext.data.JsonStore({
				url:"SearchPracLawyerInfo.jsj?pracLawName="+pracLawName+"&pracGuideTeacher="+pracGuideTeacher,
				totalProperty: 'totalCount',
			    root: 'result',
				fields:["praclawid","praclawname","birthtime","praclawsex","politicalstatus",
				"educationallevel","graduateschool","praclawphone","starttime","endtime",
				"pracagreement","identitynumber","parclawemail","practicenumber",
				"guideteacher","frontoccupation","householdeaddr","archiveaddr","eligiblenumber"]
			});
		store.reload({
			params:{
				start:0,
				limit:5
				}
			});
		var colModel = new Ext.grid.ColumnModel([//配置表格列
				new Ext.grid.RowNumberer({
					header : '行号',
					width : 40
				}),
				cb,
				{header: "实习律师ID", width: 100, dataIndex: 'praclawid', sortable: true},
				{header: "实习律师姓名", width: 100, dataIndex: 'praclawname', sortable: true},
				{header: "出生年月", width: 100, dataIndex: 'birthtime', sortable: true},
				{header: "性别", width: 100, dataIndex: 'praclawsex', sortable: true},
				{header: "政治面貌", width: 100, dataIndex: 'politicalstatus', sortable: true},
				{header: "文化程度", width: 100, dataIndex: 'educationallevel', sortable: true},
				{header: "毕业院校", width: 100, dataIndex: 'graduateschool', sortable: true},
				{header: "联系方式", width: 100, dataIndex: 'praclawphone', sortable: true},
				{header: "实习开始时间", width: 100, dataIndex: 'starttime', sortable: true},
				{header: "实习结束时间", width: 100, dataIndex: 'endtime', sortable: true},
				{header: "协议年限", width: 100, dataIndex: 'pracagreement', sortable: true},
				{header: "身份证号", width: 100, dataIndex: 'identitynumber', sortable: true},
				{header: "邮箱", width: 100, dataIndex: 'parclawemail', sortable: true},
				{header: "实习证号", width: 100, dataIndex: 'practicenumber', sortable: true},
				{header: "实习指导老师", width: 100, dataIndex: 'guideteacher', sortable: true},
				{header: "前职业", width: 100, dataIndex: 'frontoccupation', sortable: true},
				{header: "户籍所在地", width: 100, dataIndex: 'householdeaddr', sortable: true},
				{header: "档案所在地", width: 100, dataIndex: 'archiveaddr', sortable: true},
				{header: "资格证号", width: 100, dataIndex: 'eligiblenumber', sortable: true},
				]);

				//分页工具栏重新绑定存储器
				pagebar.bind(store);
				//重新配置GRID表格
				grid.reconfigure(store,colModel);
				grid.getView().refresh(true);
	}

    	//存储器
		var store = new Ext.data.JsonStore({
				url:"PracLawyerInfoRequest.jsj",
				totalProperty: 'totalCount',
				root: 'result',
				fields:["praclawid","praclawname","birthtime","praclawsex","politicalstatus",
				"educationallevel","graduateschool","praclawphone","starttime","endtime",
				"pracagreement","identitynumber","parclawemail","practicenumber",
				"guideteacher","frontoccupation","householdeaddr","archiveaddr","eligiblenumber"]
			});

		//加载数据
		store.load({
			params:{
				start:0,
				limit:5
				}
			});


		//获得用户权限
		var buttonDisabled=true;
		<%
			if((Integer)session.getAttribute("popedomLevel")==1){
		%>
			buttonDisabled=false;
		<%
			}
		%>



		//创建工具栏组件
		var toolbar = new Ext.Toolbar([
			{text : '实习律师基本信息'},
			'-',
			{
			text:'修改选定实习律师信息',
			iconCls:'option',
			disabled:buttonDisabled,
			handler:function(btn,pressed){
			modifyPracLawyerInfo(grid,store);
			}
			},
			'-',
			{
			text:'删除选定实习律师信息',
			iconCls:'remove',
			disabled:buttonDisabled,
			handler:function(btn,pressed){
			deletePracLawyerInfo(grid,store);
			}
			}
		]);

		//分页工具栏
		var pagebar = new Ext.PagingToolbar({
			store : store,
			pageSize : 5,
			displayInfo : true,
			displayMsg : '第 {0} ~ {1} 条 共 {2} 条',
			emptyMsg : '当前没有记录'
		});
		//创建选择模式对象
	var cb = new Ext.grid.CheckboxSelectionModel()
	//创建Grid表格组件
	var grid = new Ext.grid.GridPanel({
			renderTo : 'grid-div2',
			frame : true,
			tbar : toolbar,
			bbar : pagebar,
			trackMouseOver:true, //鼠标特效
			loadMask: true,    //是否显示正在加载
			store : store,
			height : 320,
			width : window.screen.width-220,
			stripeRows : true,
			autoScroll : true,
			viewConfig : {autoFill : false},
			sm : cb,
			columns: [//配置表格列
				new Ext.grid.RowNumberer({
					header : '行号',
					width : 40
				}),
				cb,
				{header: "实习律师ID", width: 100, dataIndex: 'praclawid', sortable: true},
				{header: "实习律师姓名", width: 100, dataIndex: 'praclawname', sortable: true},
				{header: "出生年月", width: 100, dataIndex: 'birthtime', sortable: true},
				{header: "性别", width: 100, dataIndex: 'praclawsex', sortable: true},
				{header: "政治面貌", width: 100, dataIndex: 'politicalstatus', sortable: true},
				{header: "文化程度", width: 100, dataIndex: 'educationallevel', sortable: true},
				{header: "毕业院校", width: 100, dataIndex: 'graduateschool', sortable: true},
				{header: "联系方式", width: 100, dataIndex: 'praclawphone', sortable: true},
				{header: "实习开始时间", width: 100, dataIndex: 'starttime', sortable: true},
				{header: "实习结束时间", width: 100, dataIndex: 'endtime', sortable: true},
				{header: "协议年限", width: 100, dataIndex: 'pracagreement', sortable: true},
				{header: "身份证号", width: 100, dataIndex: 'identitynumber', sortable: true},
				{header: "邮箱", width: 100, dataIndex: 'parclawemail', sortable: true},
				{header: "实习证号", width: 100, dataIndex: 'practicenumber', sortable: true},
				{header: "实习指导老师", width: 100, dataIndex: 'guideteacher', sortable: true},
				{header: "前职业", width: 100, dataIndex: 'frontoccupation', sortable: true},
				{header: "户籍所在地", width: 100, dataIndex: 'householdeaddr', sortable: true},
				{header: "档案所在地", width: 100, dataIndex: 'archiveaddr', sortable: true},
				{header: "资格证号", width: 100, dataIndex: 'eligiblenumber', sortable: true},
				]
		});
});

</script>
</head>
<body>
<table><tr><td>
<div id='searchPracWin' style="margin:8px 8px 4px 8px"></div>
</td></tr>
</table>
<div id='grid-div2' style="margin:4px 8px 8px 8px"></div>


</body>
</html>